<h5>Search Box</h5>
<div id="search-panel">

<%= form_tag({:action => 'index'}, :method => 'GET') do %>
Text: <input type="text" name="filter[text]" id="filter_text" value="<%= @filter[:text] if !@filter.nil? %>">


User:
<select name="filter[user_id]" id="filter_user_id">
	<option value="">- All Users -</option>
	<% @users.each do |user|
		@selected = ''
		if !@filter.nil?
			@selected = user.id.to_s == @filter[:user_id] ? 'selected=selected' : ''
		end
	%>
		<option value="<%= user.id.to_s %>" <%= @selected %> ><%= user.username %></option>
	<% end %>
</select>


Status:
<select name="filter[article_status_id]" id="filter_article_status_id">
	<option value="">- All statuses -</option>
	<% @article_statuses.each do |article_status|
		@selected = ''
		if !@filter.nil?
			@selected = article_status.id.to_s == @filter[:article_status_id] ? 'selected=selected' : ''
		end
	%>
		<option value="<%= article_status.id.to_s %>" <%= @selected %> ><%= article_status.title %></option>
	<% end %>
</select>
<input type="submit" title="Search" value="Search" class="button grey" style="height:auto" />

<% end %>

</div>